<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:91:"D:\PHPTutorial\WWW\ERP\public/../application/admin\view\product_lists\products\bomlist.html";i:1574848866;s:65:"D:\PHPTutorial\WWW\ERP\application\admin\view\layout\default.html";i:1574218857;s:62:"D:\PHPTutorial\WWW\ERP\application\admin\view\common\meta.html";i:1574218857;s:64:"D:\PHPTutorial\WWW\ERP\application\admin\view\common\script.html";i:1574218857;}*/ ?>
<!DOCTYPE html>
<html lang="<?php echo $config['language']; ?>">
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">

<link rel="shortcut icon" href="/public/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/public/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/public/assets/js/html5shiv.js"></script>
  <script src="/public/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>
    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !$config['fastadmin']['multiplenav']): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                <div class="panel panel-default panel-intro" style="margin-bottom: 20px">
    <?php echo build_heading(); ?>

    <div class="panel-body">
        <div id="myTabContent2" class="tab-content">
            <div class="tab-pane fade active in" id="three">
                <div class="widget-body no-padding">
                    <form id="find-form" class="form-horizontal" method="POST" action="" multiple="true">
                        <a data-url="product_lists/products?status=radio&action=1" href="#"  class="btn btn-success btn-ajaxss pull-left search"  data-title="选择产品" id="choose_product" style="margin-right: 10px"><?php if($product_name): ?><?php echo $product_name; else: ?>选择产品<?php endif; ?></a>
                        <input type="hidden" id="product" name="temp[0][bn]" value="<?php echo $bn; ?>">
                        <input type="hidden" id="product_name" name="temp[0][name]" value="<?php echo $product_name; ?>">
                        <div class="pull-left search" style="margin-right: 10px"><input class="form-control" type="number" name="temp[0][num]" value="<?php echo $num; ?>" placeholder="生产数量"></div>
                        <div class="pull-left search">
                            <button type="submit" class="btn btn-success"><?php echo __('OK'); ?></button>
                            <!--<button type="reset" id="btn" class="btn btn-default btn-embossed"><?php echo __('Reset'); ?></button>-->
                        </div>
                        <input name="search" type="hidden" value="1">
                    </form>
                </div>
            </div>

        </div>
    </div>
</div>
<div class="panel panel-default panel-intro">
    <?php echo build_heading(); ?>

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap" width="100%">
                        <thead>
                        <tr>
                            <th>半成品编号</th>
                            <th>半成品名称</th>
                            <th>半成品规格</th>
                            <th>单位</th>
                            <th>需求数量</th>
                            <th>当前库存</th>
                        </tr>
                        </thead>
                        <tbody id="MyPublishShow">
                        <?php if(is_array($part_pro) || $part_pro instanceof \think\Collection || $part_pro instanceof \think\Paginator): $i = 0; $__LIST__ = $part_pro;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                        <tr>
                            <td><?php echo $vo['bn']; ?></td>
                            <td><?php echo $vo['name']; ?></td>
                            <td><?php echo $vo['spec']; ?></td>
                            <td><?php echo $vo['unit']; ?></td>
                            <td><?php echo $vo['Dosage']; ?></td>
                            <td><?php echo $vo['num']; ?></td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
<div class="panel panel-default panel-intro" style="margin-top: 20px">
    <?php echo build_heading(); ?>

    <div class="panel-body">
        <div id="myTabContent1" class="tab-content">
            <div class="tab-pane fade active in" id="two">
                <div class="widget-body no-padding">
                    <table id="table1" class="table table-striped table-bordered table-hover table-nowrap" width="100%">
                        <thead>
                        <tr>
                            <th>原材料编号</th>
                            <th>原材料名称</th>
                            <th>原材料规格</th>
                            <th>单位</th>
                            <th>需求数量</th>
                            <th>当前库存</th>
                            <th>需采购数量</th>
                        </tr>
                        </thead>
                        <tbody id="MyPublishShow1">
                            <?php if(is_array($pro) || $pro instanceof \think\Collection || $pro instanceof \think\Paginator): $i = 0; $__LIST__ = $pro;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
                            <tr>
                                <td><?php echo $vo['bn']; ?></td>
                                <td><?php echo $vo['name']; ?></td>
                                <td><?php echo $vo['spec']; ?></td>
                                <td><?php echo $vo['unit']; ?></td>
                                <td><?php echo $vo['Dosage']; ?></td>
                                <td><?php echo $vo['num']; ?></td>
                                <td><?php if($vo['Dosage']-$vo['num']<0): ?>0<?php else: ?><?php echo $vo['Dosage']-$vo['num']; endif; ?></td>
                            </tr>
                            <?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
<script>
    window.onload = function(){
        var btn = document.getElementById("btn");
        var choose_product = document.getElementById("choose_product");
        choose_product.onclick = function(obj){
            var url = $(this).attr('data-url');
            if(!url) return false;
            var msg = $(this).attr('data-title');
            var width = $(this).attr('data-width');
            var height = $(this).attr('data-height');
            var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%'];
            var options = {
                shadeClose: false,
                shade: [0.3, '#393D49'],
                area: area,
                callback:function(value){
                    if(value){
                        var choose_product = document.getElementById("choose_product");
                        choose_product.innerText = value[0].name;
                        var product = document.getElementById("product");
                        product.value = value[0].bn;
                        var product_name = document.getElementById("product_name");
                        product_name.value = value[0].name;
                    }else{
                        Layer.alert('请选择一个产品');
                    }
                }
            };
            Fast.api.open(url,msg,options);
        }
    };
</script>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/public/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/public/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
    </body>
</html>